"use strict";

var _lodash = _interopRequireDefault(require("lodash"));

require("./index.css");

var _print = _interopRequireDefault(require("./print.png"));

var _print2 = require("@/print.js");

var _math = require("@/math.js");

var _echoword_personpublish = _interopRequireDefault(require("echoword_personpublish"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function component() {
  var element = document.createElement('div');
  var btn = document.createElement('button');
  element.innerHTML = _lodash["default"].join(["hellow", "webpack"], "-");
  element.classList.add("hello");
  btn.innerHTML = "click counld print!";
  btn.addEventListener('click', _print2.print);
  btn.addEventListener('click', _math.randomNumber); // 添加图像

  var print = new Image();
  print.src = _print["default"];
  element.appendChild(print);
  element.appendChild(btn);
  return element;
}

_echoword_personpublish["default"].echoword("npm 测试打印包!");

var element = component();
document.body.appendChild(element);

if (module.hot) {
  module.hot.accept("@/print.js", function () {
    console.log("Accepting the updated print moudle!");
    document.removeChild(element);
    element = component();
    document.body.appendChild(element);
  });
} // const p1 = new Promise((resolve,reject)=>{
//   console.log("this is Promise");
//   resolve("成功了!")
// }).then((res)=>{
//   console.log(res)
// },err=>{
//   console.log(err)
// })